package com.epoch.controller;

import com.epoch.entity.Course;
import com.epoch.service.CourseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author admin
 */
@Slf4j
@RestController
public class CourseController {

    @Autowired
    private CourseService courseService;

    @GetMapping("course")
    public Course getCourseById(String courseId){
        log.info("CourseController: "+courseId);
        return courseService.getCourseById(courseId);
    }

    @GetMapping("course2")
    public List<Course> getCourseByTypeId(String typeId){
        log.info("CourseController: "+typeId);
        return courseService.getCourseByTypeId(typeId);
    }
}
